﻿/*********************************************************************
 版权所有: 版权所有(C) 2009 ,熙软研发部
 模块编号:  RoleView.aspx.cs
 作    者:范徐超
 编写日期:2009-09-10
 审    核:
 审核日期:
 描    述:规则预览页面
...........................................................................
如果模块有修改，则每次修改添加以下注释(以系统上线后为基准)：

 *********************************************************************/

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using Cisoft.Booking.Model;
using Cisoft.Booking.BLL;

public partial class Business_Booking_RuleView : WebUI.Page.BasePage
{
    private RuleMO ruleMO = new RuleMO();
    private RuleBO ruleBO = new RuleBO();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            FillModel();
        }
    }

    #region 返回事件
    /// <summary>
    /// 返回事件
    /// </summary>
    protected void butrReset_Click(object sender, ImageClickEventArgs e)
    {
        Response.Redirect("RulesManage.aspx");
    }
    #endregion

    #region 获得规则标识 int GetRuleID()
    /// <summary>
    /// 获得规则标识
    /// </summary>
    private int GetRuleID()
    {
        int id = 0;
        if (Request.QueryString["RuleID"] != null)
        {
            id = int.Parse(Request.QueryString["RuleID"].ToString());
        }

        return id;
    }
    #endregion

    #region 填充页面表格 void FillModel()
    /// <summary>
    /// 填充页面表格
    /// </summary>
    private void FillModel()
    {
        int id = GetRuleID();
        if (id > 0)
        {
            ruleMO = ruleBO.GetModel(id);

            lbl_RuleName.Text = ruleMO.RuleName;
            lbl_Break.Text = ruleMO.RuleBreakSymbol;
            lbl_RuleCode.Text = ruleMO.RuleCode;
            lbl_End.Text = ruleMO.RuleEndSymbol;
            lbl_Reply.Text = ruleMO.RuleReply;
            lbl_Send.Text = ruleMO.RuleOrderTemplate;
        }
        else
        {
            PageError("系统不存在该规则！", "RulesManage.aspx");
        }
    }
    #endregion
}
